package com.nkzy.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code; //1:表示成功，0：表示失败
    private String message;
    private Object data;
    //为了方便操作，提供三个静态的方法
    public static Result success(){
        return new Result(1,"操作成功",null);
    }
    public static Result success(Object data){
        return new Result(1,"操作成功",data);
    }
    public static Result error(String message){
        return new Result(0,message,null);
    }
}
